Integrand size = 31, antiderivative size = 64 \[ \int (a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^n \, dx=\frac {2 i a^2 (c-i c \tan (e+f x))^n}{f n}-\frac {i a^2 (c-i c \tan (e+f x))^{1+n}}{c f (1+n)} \]
[Out]
Time = 0.16 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3603, 3568, 45} \[ \int (a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^n \, dx=\frac {2 i a^2 (c-i c \tan (e+f x))^n}{f n}-\frac {i a^2 (c-i c \tan (e+f x))^{n+1}}{c f (n+1)} \]
[In]
[Out]
Rule 45
Rule 3568
Rule 3603
Rubi steps \begin{align*} \text {integral}& = \left (a^2 c^2\right ) \int \sec ^4(e+f x) (c-i c \tan (e+f x))^{-2+n} \, dx \\ & = \frac {\left (i a^2\right ) \text {Subst}\left (\int (c-x) (c+x)^{-1+n} \, dx,x,-i c \tan (e+f x)\right )}{c f} \\ & = \frac {\left (i a^2\right ) \text {Subst}\left (\int \left (2 c (c+x)^{-1+n}-(c+x)^n\right ) \, dx,x,-i c \tan (e+f x)\right )}{c f} \\ & = \frac {2 i a^2 (c-i c \tan (e+f x))^n}{f n}-\frac {i a^2 (c-i c \tan (e+f x))^{1+n}}{c f (1+n)} \\ \end{align*}
Time = 0.99 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.73 \[ \int (a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^n \, dx=-\frac {a^2 (c-i c \tan (e+f x))^n (-i (2+n)+n \tan (e+f x))}{f n (1+n)} \]
[In]
[Out]
Time = 2.76 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.22
method | result | size |
derivativedivides | \(\frac {i \left (a^{2} n +2 a^{2}\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f n \left (1+n \right )}-\frac {a^{2} \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (1+n \right )}\) | \(78\) |
default | \(\frac {i \left (a^{2} n +2 a^{2}\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f n \left (1+n \right )}-\frac {a^{2} \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (1+n \right )}\) | \(78\) |
norman | \(\frac {i \left (a^{2} n +2 a^{2}\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f n \left (1+n \right )}-\frac {a^{2} \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (1+n \right )}\) | \(78\) |
risch | \(\frac {2 i a^{2} c^{n} 2^{n} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{-n} \left (n \,{\mathrm e}^{-\frac {i \operatorname {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{3} \pi n}{2}} {\mathrm e}^{\frac {i \operatorname {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \operatorname {csgn}\left (i c \right ) \pi n}{2}} {\mathrm e}^{\frac {i \operatorname {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \pi \,\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) n}{2}} {\mathrm e}^{-\frac {i \operatorname {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \operatorname {csgn}\left (i c \right ) \pi \,\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) n}{2}} {\mathrm e}^{2 i f x} {\mathrm e}^{2 i e}+{\mathrm e}^{-\frac {i \operatorname {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{3} \pi n}{2}} {\mathrm e}^{\frac {i \operatorname {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \operatorname {csgn}\left (i c \right ) \pi n}{2}} {\mathrm e}^{\frac {i \operatorname {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \pi \,\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) n}{2}} {\mathrm e}^{-\frac {i \operatorname {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \operatorname {csgn}\left (i c \right ) \pi \,\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) n}{2}} {\mathrm e}^{2 i f x} {\mathrm e}^{2 i e}+{\mathrm e}^{\frac {i \operatorname {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \pi n \left (\operatorname {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )-\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )\right ) \left (-\operatorname {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )+\operatorname {csgn}\left (i c \right )\right )}{2}}\right )}{\left (1+n \right ) f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) n}\) | \(458\) |
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.22 \[ \int (a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^n \, dx=-\frac {2 \, {\left (-i \, a^{2} + {\left (-i \, a^{2} n - i \, a^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac {2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n^{2} + f n + {\left (f n^{2} + f n\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 311 vs. \(2 (49) = 98\).
Time = 0.47 (sec) , antiderivative size = 311, normalized size of antiderivative = 4.86 \[ \int (a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^n \, dx=\begin {cases} x \left (i a \tan {\left (e \right )} + a\right )^{2} \left (- i c \tan {\left (e \right )} + c\right )^{n} & \text {for}\: f = 0 \\- \frac {2 a^{2} f x \tan {\left (e + f x \right )}}{2 c f \tan {\left (e + f x \right )} + 2 i c f} - \frac {2 i a^{2} f x}{2 c f \tan {\left (e + f x \right )} + 2 i c f} - \frac {i a^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan {\left (e + f x \right )}}{2 c f \tan {\left (e + f x \right )} + 2 i c f} + \frac {a^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 c f \tan {\left (e + f x \right )} + 2 i c f} + \frac {4 a^{2}}{2 c f \tan {\left (e + f x \right )} + 2 i c f} & \text {for}\: n = -1 \\2 a^{2} x + \frac {i a^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} - \frac {a^{2} \tan {\left (e + f x \right )}}{f} & \text {for}\: n = 0 \\- \frac {a^{2} n \left (- i c \tan {\left (e + f x \right )} + c\right )^{n} \tan {\left (e + f x \right )}}{f n^{2} + f n} + \frac {i a^{2} n \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{f n^{2} + f n} + \frac {2 i a^{2} \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{f n^{2} + f n} & \text {otherwise} \end {cases} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 272 vs. \(2 (56) = 112\).
Time = 0.81 (sec) , antiderivative size = 272, normalized size of antiderivative = 4.25 \[ \int (a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^n \, dx=\frac {2^{n + 1} a^{2} c^{n} \cos \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) - i \cdot 2^{n + 1} a^{2} c^{n} \sin \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + 2 \, {\left (a^{2} c^{n} n + a^{2} c^{n}\right )} 2^{n} \cos \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) + 2 \, {\left (-i \, a^{2} c^{n} n - i \, a^{2} c^{n}\right )} 2^{n} \sin \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right )}{{\left (-i \, n^{2} + {\left (-i \, n^{2} - i \, n\right )} \cos \left (2 \, f x + 2 \, e\right ) + {\left (n^{2} + n\right )} \sin \left (2 \, f x + 2 \, e\right ) - i \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} f} \]
[In]
[Out]
\[ \int (a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^n \, dx=\int { {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{2} {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n} \,d x } \]
[In]
[Out]
Time = 0.40 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.75 \[ \int (a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^n \, dx=\frac {a^2\,{\left (\frac {c\,\left (\cos \left (2\,e+2\,f\,x\right )+1-\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,e+2\,f\,x\right )+1}\right )}^n\,\left (n\,1{}\mathrm {i}+\cos \left (2\,e+2\,f\,x\right )\,2{}\mathrm {i}+n\,\cos \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}-n\,\sin \left (2\,e+2\,f\,x\right )+2{}\mathrm {i}\right )}{f\,n\,\left (\cos \left (2\,e+2\,f\,x\right )+1\right )\,\left (n+1\right )} \]
[In]
[Out]